﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ctolua.Models
{
    public class MItemKey
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int key;
        /// <summary>
        /// 预设 物品昵称
        /// </summary>
        public string name => game_api.get_item_name_by_type(this.key);
        /// <summary>
        /// 预设 物品描述
        /// </summary>
        public string desc => game_api.get_item_desc_by_type(this.key);
        /// <summary>
        /// icon图标的图片id
        /// </summary>
        public int? icon => game_api.get_icon_id_by_item_type(this.key);
        /// <summary>
        /// 获取物品商品售价
        /// </summary>
        /// <param name="res_type"> 资源类型 </param>
        /// <returns>售价</returns>
        public double money(string res_type) => game_api.get_item_buy_price(this.key, res_type).@float();
        public MItemKey(int key)
        {
            this.key = key;
        }
    }
}
